package com.spbdx.system.service.impl;

import com.spbdx.common.utils.DateUtils;
import com.spbdx.system.domain.EventOrderFlow;
import com.spbdx.system.mapper.EventOrderFlowMapper;
import com.spbdx.system.service.IEventOrderFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工单流转表Service业务层处理
 *
 * @author cms
 * @date 2024-08-07
 */
@Service
public class EventOrderFlowServiceImpl implements IEventOrderFlowService
{
    @Autowired
    private EventOrderFlowMapper eventOrderFlowMapper;

    /**
     * 查询工单流转表
     *
     * @param flowId 工单流转表主键
     * @return 工单流转表
     */
    @Override
    public EventOrderFlow selectEventOrderFlowByFlowId(Long flowId)
    {
        return eventOrderFlowMapper.selectEventOrderFlowByFlowId(flowId);
    }

    /**
     * 查询工单流转表列表
     *
     * @param eventOrderFlow 工单流转表
     * @return 工单流转表
     */
    @Override
    public List<EventOrderFlow> selectEventOrderFlowList(EventOrderFlow eventOrderFlow)
    {
        return eventOrderFlowMapper.selectEventOrderFlowList(eventOrderFlow);
    }

    /**
     * 新增工单流转表
     *
     * @param eventOrderFlow 工单流转表
     * @return 结果
     */
    @Override
    public int insertEventOrderFlow(EventOrderFlow eventOrderFlow)
    {
        eventOrderFlow.setCreateTime(DateUtils.getNowDate());
        return eventOrderFlowMapper.insertEventOrderFlow(eventOrderFlow);
    }

    /**
     * 修改工单流转表
     *
     * @param eventOrderFlow 工单流转表
     * @return 结果
     */
    @Override
    public int updateEventOrderFlow(EventOrderFlow eventOrderFlow)
    {
        eventOrderFlow.setUpdateTime(DateUtils.getNowDate());
        return eventOrderFlowMapper.updateEventOrderFlow(eventOrderFlow);
    }

    /**
     * 批量删除工单流转表
     *
     * @param flowIds 需要删除的工单流转表主键
     * @return 结果
     */
    @Override
    public int deleteEventOrderFlowByFlowIds(Long[] flowIds)
    {
        return eventOrderFlowMapper.deleteEventOrderFlowByFlowIds(flowIds);
    }

    /**
     * 删除工单流转表信息
     *
     * @param flowId 工单流转表主键
     * @return 结果
     */
    @Override
    public int deleteEventOrderFlowByFlowId(Long flowId)
    {
        return eventOrderFlowMapper.deleteEventOrderFlowByFlowId(flowId);
    }
}